﻿using System;
using System.Collections.Generic;
using System.Linq;

using Recon.Portal.DataObjects;
using Recon.Portal.Data;

namespace Recon.Portal.Business
{
    public class RoleEntity
    {
        #region: Public Constructor
        public RoleEntity()
        {

        }
#endregion

        #region: Public Methods
        public int RegisterRole(UserRole role, string userID)
        {
            DBFactory db = new DBFactory();
            return db.RegisterRole(role,userID);
        }

        public int ModifyRole(UserRole role, string userID)
        {
            DBFactory db = new DBFactory();
            return db.ModifyRole(role, userID);
        }

        public int addRoleMenuMapping(string roleId, string menuId, int isEnabled, string userID,string CustomerID)
        {
            DBFactory db = new DBFactory();
            return db.addRoleMenuMapping(roleId, menuId, isEnabled, userID, CustomerID);
        }

        public int removeRoleMenuMapping(string roleId, string menuId)
        {
            DBFactory db = new DBFactory();
            return db.removeRoleMenuMapping(roleId, menuId);
        }

        public UserRole GetRoleDetailsByRoleId(string RoleID, int option)
        {
            DBFactory db = new DBFactory();
            return db.GetRoleDetailsByRoleId(RoleID, option);
        }

        public List<UserRole> GetAllRoles(bool systemIncluded,string custId)
        {
            DBFactory db = new DBFactory();
            return db.GetAllRoles(systemIncluded,custId);
        }

        public int DeleteRole(string roleId)
        {
            DBFactory db = new DBFactory();
            return db.DeleteRole(roleId);
        }
        #endregion
    }
}